#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include<assert.h>
void* my_memmove(void* des, void* src,int size)
{
	void* ret = des;
	assert(des && src);
	if (des < src)
	{
		while (size)
		{
			*(char*)des = *(char*)src;
			des = (char*)des + 1;
			src = (char*)src + 1;
			size--;
		}
	}
	else
	{
		while (size)
		{
			*((char*)des + (size-1)) = *((char*)src + (size-1));
			size--;
		}
	}
	return ret;
}
int main()
{
	int arr[10] = { 1,2,3,4,5,6,7,8,9,10 };
	my_memmove(arr + 3, arr + 1, 20);
	int i = 0;
	for (i = 0; i < 10; i++)
	{
		printf("%d ", arr[i]);
	}
	return 0;
}
